package cn.wolfcode.transfer.service.impl;

import cn.wolfcode.transfer.domain.BusinessConsumption;
import cn.wolfcode.transfer.mapper.BusinessReportMapper;
import cn.wolfcode.transfer.qo.QueryObject;
import cn.wolfcode.transfer.service.IBusinessReportService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BusinessReportServiceImpl implements IBusinessReportService {
    @Autowired
    private BusinessReportMapper businessReportMapper;

    @Override
    public PageInfo<BusinessConsumption> select(QueryObject queryObject) {
        PageHelper.startPage(queryObject.getCurrentPage(), queryObject.getPageSize());
        List<BusinessConsumption> businessConsumptions = businessReportMapper.selectForList(queryObject);
        return new PageInfo<>(businessConsumptions);
    }
}
